****What follows are the Stata commands necessary to produce the figures in the article. Before running the commands, convert all datasets into Stata format, or otherwise infile them at the relevant command. Also include the relevant file path information for each dataset.

****to produce Figure 1
use "votes.dta"
merge m:1 congress state_icpsr using "populations.dta"
drop _merge
gen yesvote = cast_code
recode yesvote (1=1) (6=0) (else=.)
gen novote=cast_code
recode novote (6=1) (1=0) (else=.)
gen yespop= (yesvote * population)/2
gen nopop= (novote * population)/2
collapse (sum) yesvote novote yespop nopop, by(congress rollnumber)
gen yespopfrac= yespop/(yespop+ nopop)
gen yesvotefrac= yesvote/(yesvote+ novote)
gen var=.5
twoway (scatter yespopfrac yesvotefrac, sort mcolor(gs6) msize(vtiny) msymbol(circle)) (line yespopfrac var, lcolor(black) lpattern(solid)) (line var yesvotefrac, lcolor(black)), ytitle(Fraction population yes) ytitle(, size(small)) ylabel(0(.1)1, labsize(small) angle(horizontal)) xtitle(Fraction vote yes) xtitle(, size(small)) xlabel(0(.1)1, labsize(small)) legend(off) scheme(s1mono)
clear


****to produce Figure 2
use "votes.dta"
merge m:1 congress state_icpsr using "populations.dta"
drop _merge
gen yesvote = cast_code
recode yesvote (1=1) (6=0) (else=.)
gen novote=cast_code
recode novote (6=1) (1=0) (else=.)
gen yespop= (yesvote * population)/2
gen nopop= (novote * population)/2
collapse (sum) yesvote novote yespop nopop, by(congress rollnumber)
gen cmy=0
replace cmy=1 if (yesvote > novote) & (yespop< nopop)
gen cmn=0
replace cmn=1 if (novote >=yesvote) & (yespop>nopop)
gen cm = cmy+cmn
collapse (mean) cm, by(congress)
replace congress=(2*congress) - 1 + 1788
twoway (connected cm congress, sort msymbol(none) lcolor(black)), ytitle(Fraction countermajoritarian) ytitle(, size(small)) ylabel(0(.05).4, labsize(small) angle(horizontal)) xtitle(, size(zero)) xlabel(1789(10)2021, labsize(small) angle(forty_five)) scheme(s1mono)
clear


****to produce Figures 3
use "independent_vars.dta"
replace congress=(2*congress) - 1 + 1788
twoway (connected gini congress, sort msymbol(none) lcolor(black)), ytitle(Gini coefficient) ytitle(, size(small)) ylabel(.35(.05).5, labsize(small) angle(horizontal)) xtitle(, size(zero)) xlabel(1789(10)2021, labsize(small) angle(forty_five)) scheme(s1mono)
clear


****to produce Figure 4
use "independent_vars.dta"
replace congress=(2*congress) - 1 + 1788
twoway (connected closevote congress, sort msymbol(none) lcolor(black)), ytitle(Close votes) ytitle(, size(small)) ylabel(.2(.1).6, labsize(small) angle(horizontal)) xtitle(, size(zero)) xlabel(1789(10)2021, labsize(small) angle(forty_five)) scheme(s1mono)
clear


****to produce Figure 5
use "independent_vars.dta"
replace congress=(2*congress) - 1 + 1788
twoway (connected majfrac congress, sort msymbol(none) lcolor(black)), ytitle(Majority party population coverage) ytitle(, size(small)) ylabel(.4(.1).9, labsize(small) angle(horizontal)) xtitle(, size(zero)) xlabel(1789(10)2021, labsize(small) angle(forty_five)) scheme(s1mono)
clear


****to produce Figure 6
use "motions.dta"
gen supercoll=.
replace supercoll=0 if supermaj==0
replace supercoll=1 if supermaj>0
collapse (mean) supercoll, by(congress)
replace congress=(2*congress) - 1 + 1788
twoway (connected supercoll congress, sort msymbol(none) lcolor(black)), ytitle(Proportion supermajority required) ytitle(, size(small)) ylabel(0(.1).5, labsize(small) angle(horizontal)) xtitle(, size(zero)) xlabel(1789(10)2021, labsize(small) angle(forty_five)) scheme(s1mono)
clear


****to produce Figure 7
use "motions.dta"
keep if congress > 96
gen cloture=.
replace cloture = 1 if supermaj==2
recode cloture (.=0)
gen budwaive=.
replace budwaive=1 if supermaj==3
recode budwaive (.=0)
gen specorder=.
replace specorder = 1 if supermaj==4
recode specorder (.=0)
replace congress=(2*congress) - 1 + 1788
graph bar (sum) cloture budwaive specorder, over(congress, label(labcolor("black") angle(forty_five) labsize(small))) stack bar(1, fcolor(black) lcolor(none)) bar(2, fcolor(black) fintensity(inten60) lcolor(none)) bar(3, fcolor(black) fintensity(inten30) lcolor(none)) ytitle(`"Number of roll calls"') ytitle(, size(small)) ylabel(, labsize(small) angle(horizontal)) legend(order(1 "Cloture" 2 "Budget waivers" 3 "Senate orders") rows(1) size(small)) scheme(s1mono)
clear


****to produce Figure 8
use "votes.dta"
merge m:1 congress state_icpsr using "populations.dta"
drop _merge
gen yesvote = cast_code
recode yesvote (1=1) (6=0) (else=.)
gen novote=cast_code
recode novote (6=1) (1=0) (else=.)
gen yespop= (yesvote * population)/2
gen nopop= (novote * population)/2
collapse (sum) yesvote novote yespop nopop, by(congress rollnumber)
gen cmy=0
replace cmy=1 if (yesvote > novote) & (yespop< nopop)
gen cmn=0
replace cmn=1 if (novote >=yesvote) & (yespop>nopop)
gen cm = cmy+cmn
merge 1:1 congress rollnumber using "motions.dta"
drop _merge
keep if invoke==1
keep if yesvote/(yesvote+novote) > .5
gen counter=.
replace counter=1 if yespop>nopop
replace counter=0 if counter==.
replace congress=(2*congress) - 1 + 1788
tab congress counter
gen maj=counter
recode maj (1=0) (0=1)
keep if congress>1963
graph bar (sum) counter maj, over(congress, label(labcolor("black") angle(forty_five) labsize(small))) stack bar(1, fcolor(black) lcolor(none)) bar(2, fcolor(black) fintensity(inten50) lcolor(none)) bar(3, fcolor(black) fintensity(inten30) lcolor(none)) ytitle(`"Number of defeated cloture motions"') ytitle(, size(small)) ylabel(, labsize(small) angle(horizontal)) legend(order(1 "Countermajoritarian" 2 "Majoritarian") rows(1) size(small)) scheme(s1mono)
clear


*****to produce Figure 9
use "votes.dta"
merge m:1 congress state_icpsr using "populations.dta"
drop _merge
gen yesvote = cast_code
recode yesvote (1=1) (6=0) (else=.)
gen novote=cast_code
recode novote (6=1) (1=0) (else=.)
gen yespop= (yesvote * population)/2
gen nopop= (novote * population)/2
collapse (sum) yesvote novote yespop nopop, by(congress rollnumber)
gen cmy=0
replace cmy=1 if (yesvote > novote) & (yespop< nopop)
gen cmn=0
replace cmn=1 if (novote >=yesvote) & (yespop>nopop)
gen cm = cmy+cmn
keep congress rollnumber cm cmy cmn
merge 1:m congress rollnumber using "votes.dta"
drop _merge
gen yesvote = cast_code
recode yesvote (1=1) (6=0) (else=.)
gen novote=cast_code
recode novote (6=1) (1=0) (else=.)
gen cmvote=.
replace cmvote = 1 if yesvote==1 & cmy==1
replace cmvote = 1 if novote==1 & cmn==1
recode cmvote (.=0)
replace cmvote=. if yesvote==.
*the party recodes that follow concern five "independents" and one "conservative" who affiliated with a major party on organizational matters
recode party_code (328=100) if icpsr==41300
recode party_code (328=100) if icpsr==29147
recode party_code (328=100) if icpsr==94240
recode party_code (328=100) if icpsr==10802
recode party_code (112=200) if icpsr==13100
recode party_code (328=100) if icpsr==6738
keep if congress>78
keep if cm==1
collapse (mean) cmvote, by(congress rollnumber party_code)
collapse (mean) cmvote, by(congress party_code)
replace congress=(2*congress) - 1 + 1788
twoway (connected cmvote congress if party_code==200, sort msymbol(none) lcolor(black)) (connected cmvote congress if party_code==100, sort msymbol(none) lcolor(gs11) lpattern(solid)), ytitle(`"Average fraction supporting side with the most votes"') ytitle(, size(small)) ylabel(, labsize(small) angle(horizontal)) xtitle(, size(zero)) xlabel(1945(2)2021, labsize(small) angle(forty_five)) legend(order(1 "Republicans" 2 "Democrats") rows(1) size(small)) scheme(s1mono)
clear
